package com.javathread.th1;

public class JoinTest {

	public static void main(String[] args) {
		Thread t2 = new Thread() {
			@Override
			public void run() {
				System.out.println("t2 is running");
			}
			
		};
		
		Thread t1 = new Thread() {
			@Override
			public void run() {
				try {
					t2.join();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				System.out.println("t1 is running");
			}
		};
		
		t1.start();
		t2.start();
	}

}
